#include "Timer_time.h"
#include "LED.h"
void Timer_time_init()
{

			/* enable tmr1 clock */
		crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);

		/* tmr1 configuration */
		/* time base configuration */
		/* systemclock/19200/10000 = 1hz */
		tmr_base_init(TMR2, (SystemCoreClock/150000) - 1, 9);
		tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
		/* overflow interrupt enable */
		tmr_interrupt_enable(TMR2, TMR_OVF_INT, TRUE);

		/* tmr1 overflow interrupt nvic init */
		nvic_irq_enable(TMR2_GLOBAL_IRQn, 0, 0);
		tmr_counter_enable(TMR2, TRUE);
}